<?php
	$sql = "SELECT * FROM HOIVIEN, CHUCVU, TAIKHOAN, CHIHOI WHERE HOIVIEN.MACV=CHUCVU.MACV AND HOIVIEN.MAHV=TAIKHOAN.MAHV AND HOIVIEN.MACH=CHIHOI.MACH AND HOIVIEN.MAHV='".$_SESSION['mahv']."'";
	$result=mysqli_query($con,$sql);
	$row=mysqli_fetch_array($result);
?>
<span class='thongbao' ><h4><strong><?php if(isset($_GET['result'])) echo $_GET['result']; ?></strong></h4></span>
<div>
	<form id="doimatkhau" action="php sources/DoiMatKhau.php" method="post" onsubmit="return kiemtramatkhau();">
		<fieldset>
				<table id='doimk'>
					<tr class='legend'>
						<td colspan="2" align="center" >Đổi mật khẩu</td>
					</tr>
					<tr>
						<td class='firstcol'>Mật khẩu cũ</td>
						<td><input id='matkhaucu' name='matkhaucu' type="password"  required pattern="(\w|\W){6,}" title="mật khẩu phải có ít nhất 6 ký tự"/>
						<p style="color:red"> <?php if(isset($_GET['tbmkcu'])) echo $_GET['tbmkcu']; ?> </p>
						</td>
					</tr>
					<tr>
						<td class='firstcol'>Mật khẩu mới</td><td><input id='matkhaumoi1' name='matkhaumoi1' type="password" required pattern="(\w|\W){6,}" title="mật khẩu phải có ít nhất 6 ký tự"/><p id="tbmkmoi1"></p></td>
					</tr>
					<tr>
						<td class='firstcol'>Xác nhận mật khẩu</td><td><input id='matkhaumoi2' name='matkhaumoi2' type="password" required pattern="(\w|\W){6,}" title="mật khẩu phải có ít nhất 6 ký tự"/><p style="color:red" id="tbmkmoi2"></p></td>
					</tr>
					<tr>
						<td colspan="2" align="center"><button id="submit" name="submit" type="submit">Lưu</button></td>
					</tr>
				</table>
		</fieldset>
	</form>
	<p style="color:red"><?php if(isset($_GET['result'])) echo $_GET['result']; ?></p>
</div>